﻿namespace Sidvall.AuthorizationManager.Data
{
	public class Claim : IClaimItem
	{
		public string ClaimType { get; set; }
		public string Value { get; set; }
		public Sidvall.Data.ComparisonOperator ComparisonOperator { get; set; }
		public bool IsEnabled { get; set; }

		public override string ToString()
		{
			if (string.IsNullOrWhiteSpace(this.ClaimType))
				return string.Empty;
			if (string.IsNullOrWhiteSpace(this.Value))
				return this.ClaimType.Trim();
			return this.ClaimType.Trim() + this.ComparisonOperator.ToString() + this.Value;
		}
	}
}
